<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content="天地图"/>
    <title>天地图－地图API－范例－图片覆盖物类</title>
    <script src="http://api.tianditu.gov.cn/api?v=4.0&tk=95f0a5688ec713adb3dd1735533f6fcb"></script>
    <script src="./ImageOverlay.js"></script>
    <script>
    var zoom = 17;
    var satelliteImageURL = 'http://t0.tianditu.gov.cn/img_w/wmts?' +
        'SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default' +
        '&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}' +
        '&tk=95f0a5688ec713adb3dd1735533f6fcb';

    function onLoad() {
        // 添加地图
        var map = new T.Map('mapDiv');
        map.centerAndZoom(new T.LngLat(106.68243, 26.22207), zoom);

        // 添加卫星图层
        var lay = new T.TileLayer(satelliteImageURL, { minZoom: 13, maxZoom: 18 });
        map.addOverLay(lay);

        // 添加2.5D图层
        var bounds = [[106.67985, 26.21905], [106.68501, 26.22510]];
        var img = new T.ImageOverlay("./map.png", bounds, {opacity: 1});
        map.addOverLay(img);
    }
    </script>
</head>
<body onLoad="onLoad()">
    <div id="mapDiv" style="position:absolute;width:100%; height:100%"></div>
</body>
</html>
